package com.tian.common.util

import android.content.Context
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import java.lang.Exception

/**
 * @author tiansongtao, Email:tiansongtao@up366.com
 * @date 2021/6/11 10:41
 */
object PackageInfoUtil {

    fun getPackageInfo(context: Context): PackageInfo? {
        var packageInfo: PackageInfo? = null
        try {
            packageInfo = context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_CONFIGURATIONS)
            return packageInfo
        } catch (e: Exception) {
            e.printStackTrace()
        }
        return packageInfo
    }
}